package org.example.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.Date;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

/**
 * @TableName d_asset
 */
@TableName(value ="d_asset")
@Data
@Schema(name = "房间资产DAsset" ,description = "请求宿舍房间信息")
public class DAsset implements Serializable {

    @Schema(description = "资产Id")
    @TableId
    private Integer aid;

    @Schema(description = "房间号")
    private String apartmentId;

    @Schema(description = "资产名称")
    private String assetName;

    @Schema(description = "资产类型")
    private String assetType;

    @Schema(description = "资产单位")
    private String assetUnit;

    @Schema(description = "资产数量")
    private Integer assetNumber;

    @Schema(description = "资产价格")
    private Double assetPrice;

    @Schema(description = "更新时间")
    private Date updateDate;

    public Double getAssetSumPrice() {
        if (assetPrice != null && assetNumber != null)
            return assetPrice * assetNumber;
        return 0.0;
    }

    private static final long serialVersionUID = 1L;
}